package com.saber.pattern.singleton;

/**
 * @author saber
 * @version 1.0
 * @Package: com.saber.pattern.singleton
 * @Date: 2017/4/10
 * @Time: 13:50
 */
public class SingletonGood {

    private SingletonGood instance = null;

    private SingletonGood() {
    }

    public SingletonGood getInstance() {
        if (null == instance) {
            init();
        }
        return instance;
    }

    private synchronized void init() {
        if (null == instance) {
            instance = new SingletonGood();
        }
    }
}
